<?php

class PictureFrame extends Block{

	public $src = "" ;
	public $size = "100px" ;
	public $height = "100px";
	public $border="1px";
	public $title = "Picture" ;
	public $alt = "..." ; //texto alternativo
	public $hspace = "2px" ;
	public $vspace = "2px" ; 
	public $absoluteURLPath = "" ;
	public function initialize(){
		$this->absoluteURLPath = $this->absoluteURL( __DIR__ );
		$this->rootURLPath = $_SERVER['DOCUMENT_ROOT'] ;
	}
	
	public function show(){
	
		$this->parseFromFile(__DIR__ . "/PictureFrame.tpl.std.html");
		$url = parse_url($this->src);
		$path = isset($url['path']) ? $this->rootURLPath.$url['path'] : "" ;
		if($this->src && file_exists( $path ) ){
			return $this->replace();
		}else {
			return "";
		}
		
		
	}

}

?>